CLI
CLI ¶
The Trendify CLI allows the code to be run from a commandline interface.
DataProductsFileName ¶
Defines arguments parsed from command line
add_argument
classmethod
¶
add_argument(parser: ArgumentParser)
Defines the argument parsing from command line
Source code in src/trendify/CLI.py
FileManager
dataclass
¶
FileManager(output_dir: Path)
Determines the folder setup for trendify directory
InputDirectories ¶
Parses the --input-directories argument from CLI
process_argument
staticmethod
¶
Converts CLI input to list of directories over which user-specified data product generator method will be mapped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg
|
str
|
Directories or glob string from CLI |
required |
Returns:
| Type | Description |
|---|---|
List[Path]
|
List of directories over which to map the user-specified product generator |
Source code in src/trendify/CLI.py
NProcs ¶
Determines the number of processors to use in parallel for running trendify commands
add_argument
classmethod
¶
add_argument(parser: ArgumentParser)
Defines the argument parsing from command line
Source code in src/trendify/CLI.py
process_argument
staticmethod
¶
process_argument(arg: str)
Type-casts input to int and caps value at 5*os.cpu_count().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg
|
int
|
Desired number of processes |
required |
Returns;
(int): Number of processes capped to 5*os.cpu_count()
Source code in src/trendify/CLI.py
TrendifyDirectory ¶
Parses the --trendify-directory argument from CLI
Source code in src/trendify/CLI.py
process_argument ¶
process_argument(arg: str) -> FileManager
Converts CLI input to list of directories over which user-specified data product generator method will be mapped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg
|
str
|
Directories or glob string from CLI |
required |
Returns:
| Type | Description |
|---|---|
FileManager
|
List of directories over which to map the user-specified product generator |
Source code in src/trendify/CLI.py
UserMethod ¶
Defines arguments parsed from command line
add_argument
classmethod
¶
add_argument(parser: ArgumentParser)
Defines the argument parsing from command line
Source code in src/trendify/CLI.py
process_argument
staticmethod
¶
process_argument(arg: str) -> ProductGenerator
Imports python method based on user CLI input
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arg
|
str
|
Method to be imported in the form |
required |
Returns:
| Type | Description |
|---|---|
Callable
|
User-specified method to be mapped over raw data directories. |
Source code in src/trendify/CLI.py
trendify ¶
Defines the command line interface script installed with python package.
Run the help via trendify -h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*pargs
|
list[Any]
|
List of flags and arguments to pass to commandline. Simulates running from commandline in pythong script. |
()
|
Source code in src/trendify/CLI.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | |